Skip to content

Config validation via TypeBox schema.#449

Draft
Gnuxie wants to merge 3 commits into
mainfrom
gnuxie/config-schema
Draft

Config validation via TypeBox schema.#449
Gnuxie wants to merge 3 commits into
mainfrom
gnuxie/config-schema

Conversation

@Gnuxie

@Gnuxie Gnuxie commented Jun 12, 2024

Copy link
Copy Markdown
Member

Part of #217.

This whole exercise was miserable and has failed, sadly (read commit messages).

https://matrix.to/#/%23draupnir%3Amatrix.org/%24FDjyJ_bxlqx6lW5Ce74RfpDQpYxT973fddywBtyNJQY?via=matrix.org&via=envs.net&via=ubuntu.com

Following up I think the best course of action is to first figure out how to report transform errors correctly (or stop using transforms).

And also migrate the config to a new format behind the scenes that can be validated more easily*.

What we mean by this is we create a new format, which we encourage everyone to use, but the old format can still be loaded just fine and is migrated to the new one transparently until they change to the new format. Which we will detect with a version number

Gnuxie added 3 commits June 11, 2024 19:41
This is the most boring and demotivating thing I have done in
awhile. Jesus christ, I hated this and it took me so long
just to convince myself to start copy and pasting things.

And I don't know why
This has failed miserably because for some reason transform errors
are reported differently to schema validation errors. They aren't
treated like a TypeBox `ValueError`.

`Config.util.extendDeep` also for some obscure reason introduces
`null`s when objects such as `sentry` are undefined,
so the schema had to be changed for that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant